package com.birdbrains.android;

import com.birdbrains.android.R;

import android.app.Activity;
import android.app.SearchManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.util.Log;
import res.drawable.*;


public class BirdBrainsActivity extends Activity {
	private static final int MENU_NEW = 1;
	private static final int MENU_SIGHTINGS = 2;
	private static final int MENU_MAP = 3;
	private static final int MENU_SETTINGS = 4;

	@Override
	/* Creates the menu items */
	
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);

	    Intent intent = getIntent();

	    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
	      String query = intent.getStringExtra(SearchManager.QUERY);
	      //doMySearch(query);
	    }
	}
	
	public boolean onCreateOptionsMenu(Menu menu) {
		
		int add = android.R.drawable.ic_menu_add;
		int more = android.R.drawable.ic_menu_more;
		int map = android.R.drawable.ic_menu_mapmode;
		int settings = android.R.drawable.ic_menu_preferences;
		
		menu.add(0, MENU_NEW, 0, "Add").setIcon(add);
		menu.add(0, MENU_SIGHTINGS, 1, "My Birds").setIcon(more);
		menu.add(0, MENU_MAP, 2, "Map").setIcon(map);
	    menu.add(0, MENU_SETTINGS, 3, "Settings").setIcon(settings);
	    
	    return true;
	}

	/* Handles item selections */
	public boolean onOptionsItemSelected(MenuItem item) {
	    switch (item.getItemId()) {
	    case MENU_NEW:
	        //newGame();
	        return true;
	    case MENU_SIGHTINGS:
	    	startActivity(new Intent(Intent.ACTION_VIEW));
	        return true;
	    case MENU_MAP:
	        //quit();
	        return true;
	    case MENU_SETTINGS:
	        //quit();
	        return true;
	    }
	    return false;
	
	}
}
